//Author: Mike Schladt - 2014
//Malware Intelligence Project

//index.js
//JS functions included in the index.html template


function change_types(value) {

    if (value == 'sample') {
        var options = '<select name="search_type">  \
            <option value="md5">MD5</option>    \
            <option value="sha1">SHA1</option>    \
            <option value="sha256">SHA256</option>    \
            <option value="sha512">SHA512</option>    \
            <option value="ssdeep">SSDEEP</option>    \
            <option value="name">File Name</option>    \
            <option value="filetype">File Type</option>    \
            <option value="size">File Size</option>    \
            <option value="sid">Sample ID</option>    \
            </select>';
    }
    
    if (value == 'tag') {
        var options = ' \
            <select name="search_type"> \
                <option value="api">API Name</option> \
                <option value="api_sequence">API Sequence</option> \
                <option value="av">AV Results</option> \
                <option value="compile_time">Compile Time</option> \
                <option value="export">Exports</option> \
                <option value="file">File</option> \
                <option value="category">File Category</option> \
                <option value="file_name">File Name</option> \
                <option value="file_size">File Size</option> \
                <option value="file_type">File Type</option> \
                <option value="imported _dll_count">Import Count</option> \
                <option value="import">Imports</option> \
                <option value="mutex">Mutex</option> \
                <option value="dns">Network: DNS</option> \
                <option value="domain">Network: Domain</option> \
                <option value="http_data">Network: Http Data</option> \
                <option value="http_uri">Network: Http URI</option> \
                <option value="http_user-agent">Network: Http User-Agent</option> \
                <option value="icmp">Network: ICMP</option> \
                <option value="irc">Network: IRC</option> \
                <option value="tcp">Network: TCP</option> \
                <option value="udp">Network: UDP</option> \
                <option value="pe_info">PE Information</option> \
                <option value="section">PE Section</option> \
                <option value="section_entropy">PE Section Entropy</option> \
                <option value="section_name">PE Section Name</option> \
                <option value="peid_signature">PEiD Signature</option> \
                <option value="process_name">Process Name</option> \
                <option value="key">Registry Key</option> \
                <option value="string">Strings</option> \
                <option value="copy_file">System Event: Copy File</option> \
                <option value="create_dir">System Event: Create Dir</option> \
                <option value="create_windowshook">System Event: Create Windowshook</option> \
                <option value="delete_dir">System Event: Delete Dir</option> \
                <option value="delete_file">System Event: Delete File</option> \
                <option value="delete_registry">System Event: Delete Registry</option> \
                <option value="delete_service">System Event: Delete Service</option> \
                <option value="dropped_file">System Event: Dropped File</option> \
                <option value="execute_file">System Event: Execute File</option> \
                <option value="findwindow_windowname">System Event: Findwindow</option> \
                <option value="load_library">System Event: Load Library</option> \
                <option value="modify_service">System Event: Modify Service</option> \
                <option value="move_file">System Event: Move File</option> \
                <option value="read_file">System Event: Read File</option> \
                <option value="read_registry">System Event: Read Registry</option> \
                <option value="write_file">System Event: Write File</option> \
                <option value="write_registry">System Event: Write Registry</option> \
                <option value="yara">Yara Signature</option> \
            </select> '
        
    }

    document.getElementById('search_type').innerHTML = options;
   
}
